package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Name UserMapper
 * @Author BaiXin
 * @Date 2022-10-16 18:15
 */
public interface UserMapper {
    /**
     * 查询所有
     * @return
     */
    @Select("select * from tb_user")
    @Results(
            id = "userResultMap",
            value = {
                    @Result(id = true,column = "id",property = "id"),
                    @Result(column = "username",property = "username"),
                    @Result(column = "gender",property = "gender"),
                    @Result(column = "idcard",property = "idcard"),
                    @Result(column = "from_address",property = "fromAddress"),
                    @Result(column = "to_address",property = "toAddress"),
                    @Result(column = "start_time",property = "startTime"),
            }
    )
    List<User> findAll();
}
